# Author 阳某
list_1 = [1,2,3,4,5,2]
list_1 = set(list_1)
print(list_1,type(list_1))

list_2 = set([3,2,8,4,7,6,8,55])
print(list_1,list_2)
#交集
print(list_1 & list_2)
print( list_1.intersection(list_2))
#并集
print(list_1.union(list_2))
print(list_1 | list_2)
#差集   在集合1中，，但是不在2中
print(list_1.difference(list_2))
print(list_1 - list_2)
print(list_2.difference(list_1))
#对称差集--->把两者都没有的都取出来
print(list_1.symmetric_difference(list_2))
print(list_1 ^ list_2)
#子集
list_3 = set([2,3,4])
print(list_3.issubset(list_1))
print(list_1.issuperset(list_3))
print("************")
list_4 = set([5,6,8])
print(list_3.isdisjoint(list_4))#没有交集返回true


list_1.add(999)
list_1.update([22,33,44])
print(list_1)

print(list_1.pop())
print(list_1.pop())

#print(list_1.remove('dd'))
print(list_1.discard(888))#删除之后不会返回那个元素
